#include "Structs.h"

double time()
{
    return clock()/(double)CLOCKS_PER_SEC;
}

QDataStream & operator << (QDataStream & out, const PlayerInfos& p)
{
	out << p.ID << p.color << p.ownedStates << p.reinforcements << p.KIA;
	return out;
}
QDataStream & operator >> (QDataStream & in, PlayerInfos& p)
{
	in >> p.ID >> p.color >> p.ownedStates >> p.reinforcements >> p.KIA;
	return in;
}


QDataStream & operator << (QDataStream & out, const StateInfos& p)
{
	out << p.ID << p.name << p.ownerID << p.connexions;
	return out;
}
QDataStream & operator >> (QDataStream & in, StateInfos& p)
{
	in >> p.ID >> p.name >> p.ownerID >> p.connexions;
	return in;
}
